import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Bullet here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Bullet extends Actor
{
    /**
     * Act - do whatever the Bullet wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public Bullet ( int rotation ) 
    {
        setRotation(rotation);
    }
    public void act() 
    {
        move(20);
        if (this.getX() < -5 || this.getX() > getWorld().getWidth()+5)
            getWorld().removeObject(this);
        else if (this.getY() < -5 || this.getY() > getWorld().getHeight()+5)
            getWorld().removeObject(this);
    }    
}
